<?php

use Encore\Admin\Form;
use Encore\Admin\Grid;


// Encore\Admin\Form::forget(['map', 'editor']);


Admin::navbar(function (\Encore\Admin\Widgets\Navbar $navbar) {

    $navbar->right(new \App\Admin\Extensions\Nav\Links());

});

Grid::init(function (Grid $grid) {

    // $grid->disableActions();

    // $grid->disablePagination();

    // $grid->disableCreateButton();

    // $grid->disableFilter();

    $grid->disableRowSelector();

    // $grid->disableColumnSelector();

    // $grid->disableTools();

    // $grid->disableExport();

    $grid->actions(function (Grid\Displayers\Actions $actions) {
        $actions->disableView();
    });
});

Form::init(function (Form $form) {

    $form->disableEditingCheck();

    $form->disableCreatingCheck();

    $form->disableViewCheck();

    $form->tools(function (Form\Tools $tools) {
        $tools->disableDelete();
        $tools->disableView();
        $tools->disableList();
        $tools->add('<a class="btn btn-sm btn-danger" onclick="javascript:history.back(-1);"><i class="fa fa-arrow-left"></i>&nbsp;&nbsp;返回</a>');
    });
});



